
import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import pinia from './store/storePersistence';
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import mytable from './components/table/index.vue'
import myform from './components/form/index.vue'
import './style/font.css';
import tablejs from './api/table'
import * as ElIcons from '@element-plus/icons-vue'
import Viewer from 'v-viewer';
import 'viewerjs/dist/viewer.css';
import myDirective from './utils/myDirective'
import permission from './utils/permission'
// 创建插件对象
const globalComponentPlugin = {
    install(app:any) {
      // 全局注册组件
      app.component('mytable', mytable);
      app.component('myform', myform);
    }
  };
  const app = createApp(App)
  //注册element图标
for (const [key, component] of Object.entries(ElIcons)) {
  app.component(key, component)
}
  app.config.globalProperties.$tablejs = tablejs;
  app.use(Viewer, {
    defaultOptions: {
      // 需要配置的属性
      toolbar: true,
      zIndex: 9999999
    }
  });
app.use(pinia).use(ElementPlus).use(myDirective).use(permission).use(globalComponentPlugin).use(router).mount('#app')
